import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '/getx/base_logic.dart';
import '/page/comm/show_web_page.dart';
import '/page/index/index_view.dart';
import '/widget/bottom_nav.dart';

class HomeLogic extends BaseLogic {
  /// todo：当前菜单索引
  int currentIndex = 0;

  /// todo：右上角小红点
  int count = -1;

  /// todo：设置菜单索引
  setIndex(value) {
    currentIndex = value;
    Get.to(()=>ShowWebPage(  url: "https://juejin.cn/post/7026525087821987848",));
    update();
  }

  /// todo：更新小红点数字
  updateCount(value){
    count = value;
    update();
  }

  /// todo：菜单对应页面
  List<Widget> bodyData = [
    IndexPage(),
    IndexPage(),
    IndexPage(),
    IndexPage(),
    IndexPage(),
  ];

  /// todo：菜单数据
  List<BottomNavModel> menuData = [
    BottomNavModel(
      img: "assets/image/edit.png",
      unImg: "assets/image/qr.png",
      label: "菜单1",
      color: Color(0xFF81955F),
      unColor: Color(0xFF959595),
    ),
    BottomNavModel(
      img: "assets/image/edit.png",
      unImg: "assets/image/qr.png",
      label: "菜单2",
      color: Color(0xFF81955F),
      unColor: Color(0xFF959595),
    ),
    BottomNavModel(
      img: "assets/image/edit.png",
      unImg: "assets/image/qr.png",
      label: "菜单3",
      color: Color(0xFF81955F),
      unColor: Color(0xFF959595),
    ),
    BottomNavModel(
      img: "assets/image/edit.png",
      unImg: "assets/image/qr.png",
      label: "菜单4",
      color: Color(0xFF81955F),
      unColor: Color(0xFF959595),
    ),
    BottomNavModel(
      img: "assets/image/edit.png",
      unImg: "assets/image/qr.png",
      label: "菜单5",
      color: Color(0xFF81955F),
      unColor: Color(0xFF959595),
    ),
  ];

  BottomNavModel navModel(img,unImg,lable){
    return BottomNavModel(
      img: "assets/image/${img}",
      unImg: "assets/image/${img}",
      label: "${lable}",
      color: Color(0xFF81955F),
      unColor: Color(0xFF959595),
    );
  }
}
